HAL XSPI migration: List of applicable concepts ¶
This section provides information about the HAL XSPI applicable architecture concepts.
Concepts for XSPI ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
-
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure
|
|
The handle structure has been renamed to
|
|
|
The structure
|
|
|
The functions
|
|
|
New APIs have been introduced to get and set XSPI features. |
|
|
In HAL2, DMA link APIs are provided with explicit naming and parameters :
|
|
|
Two functions are available to set and get user data:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each XSPI event. These functions are used to register callback functions for different XSPI events. |
|
All hardware macros have been removed from the HAL XSPI driver, and equivalent services are ensured through the LL APIs. |
|
|
The XSPI state machine is reworked to ensure transitions of the peripheral functional states. |
|
|
The HAL XSPI functions were updated to return:
|
|
|
A dedicated function for error management,
|
|
|
All TypeDef parts of the HAL XSPI driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
The HAL XSPI driver provides a new API to retrieve the clock frequency:
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including XSPI instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
Other HAL XSPI changes ¶
|
Concept |
Description |
|---|---|
|
Split timing fields and memory characteristic fields in the global configuration structure. |
User can reconfigure only timing values according to application needs (example : High speed then low speed). |
|
Provide unitary configuration to get
|
|
|
Split the usage of Hyperbus APIs and regular APIs |
Dedicated APIs are provided:
|